<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<link rel="shortcut icon" href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/logo.png"/>
	<title>{{.info.title}}</title>
	<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/mui/js/mui.min.js"></script>
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/mui/css/mui.min.css" rel="stylesheet" />
	<link rel="stylesheet" type="text/css" src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/mui/css/icons-extra.css" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/other/all.css" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/other/app.css" rel="stylesheet" />
	<!-- <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=LsCtmRBzqzIa2CnXEhm40ANbqrGlqCaQ"></script> -->
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/other/video-js.css" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/font/iconfont.css" rel="stylesheet" />
	<link rel="stylesheet" href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/swiper/css/swiper.min.css">
</head>
<style type="text/css">
	.mui-numbox{
		height: 30px;
		padding: 0 30px;
		width: 92px;
	}
	.mui-numbox .mui-input-numbox, .mui-numbox .mui-numbox-input{ 
		width: 30px !important;
		padding: 0 0px !important;
	}
	.mui-numbox [class*=btn-numbox], .mui-numbox [class*=numbox-btn]{
		width: 30px;
	}
	.swiper-container { height: 100vw;margin-top: 45px;}
	.swiper-container .swiper-slide { height: 100%; width: 100%; background-position: center; background-repeat: no-repeat; background-size: cover; }
	.swiper-pagination-bullet-active{width: 20px;border-radius: 4px;background: rgba(0, 122, 255,0.8)}
	.details{width: 100%}
	.details img{width: 100% !important;height: auto !important}
	.prdTop ul li{width: 25%;float: left;}
	.prdTop .on{color: #e31939}
	.tx-c{margin-top: 5px}
	.pj-message div ul li{width: 25% !important;height: calc(25vw - 5px)!important}
	.coupons{margin-top: 10px;background: #fff}
		.coupons dl{width: 100%;overflow:hidden;position: relative;padding: 10px;}
		.coupons dt{width: 40px;color: #999;line-height: 20px;float: left;font-size: 12px;}
		.coupons dd:nth-of-type(1){float: left;line-height: 20px;height: 20px}
		.coupons dd:nth-of-type(1) span{color: #e31939;background: #FFDAB9;padding:2px 8px;font-size: 12px;border-radius: 10px;}
		.coupons dd:nth-of-type(2){float: left;line-height: 20px;height: 20px;padding-left: 10px;width: auto;min-width: 150px;text-align: center;}
		.coupons .iconfont{color:#f40;}
		.coupons dl:before{background-image: url(''); background-repeat: no-repeat; background-position: right center; background-size: 20px; width: 30px; height: 100%;position: absolute;content:' ';right: 10px;top:0;}
	    .b_s{font-size: 16px;color: #999 !important}
		    @keyframes sheet
		{
		from {bottom: -60vh}
		to {bottom:0;}
		}
		.coupons_list_m{display: none;position: fixed;top: 0;left: 0;height: 100vh;width: 100vw;z-index: 1000}
		.coupons_list_mask{position: absolute;top: 0;left: 0;height: 100vh;width: 100vw;background: rgba(0,0,0,0.3);z-index: 1001}
		.coupons_list{position: absolute;max-height: 60vh;bottom: 0;left:0;width: 100%;z-index: 1111;}
		.coupons_list .coupon{overflow-y: scroll;background: #fff;padding-bottom: 0;overflow:hidden;height: 60vh}
		.sheet{bottom: 0;animation: sheet 0.2s linear}
		.coupon h1{font-size: 16px;text-align: center;line-height: 25px;}
		#com{padding: 8px;line-height: 25px;font-size: 16px;position: absolute;bottom: 10px;left:10px;width: calc(100% - 20px);margin: 0 }
		.cou_t{width: calc(100% - 95px)!important;}
		.cou_t{margin-top: 0px !important;padding:2px 0 3px 10px !important}
		.cou_t p{line-height: 20px}
		.coupon .price{height: 50px !important;width: calc(100% - 95px ) !important;padding:10px 0 0 10px !important;}
		.coupon .price p{font-size: 22px !important;line-height:40px;text-align:left;}
		.coupon .get_coupon{float: right;width: 95px;height: 95px;padding: 0!important;margin: 0!important}
		.coupon .get_coupon button{border: 0;outline: 0;border-radius: 0;background: #fff;line-height: 95px;
			width: 95px;height: 95px;color: #e31939;border-left: 1px #999 dashed;}
		.coupon{padding:0}
		.coupon ul{padding: 10px 10px 0 10px;overflow-y: scroll;height: 60vh}
		.surplus{height: 70px !important}
		.surplus .title p:nth-of-type(2){line-height: 20px;font-size: 14px;height: 20px;}
		.surplus .time p:nth-of-type(2){line-height: 20px;font-size: 14px;height: 20px;font-weight: 600;margin: 0 !important}
		.b_s{text-decoration: line-through;}
		.prdTop {padding-left: 35px;}
		.prdTop ul {float: left;}
		.prdTop .back {position: absolute;display: inline-block;height: 45px;width: 45px;left: 0;text-align: center;line-height: 45px;font-weight: 800;font-size: 18px;}
		.shopclassification .pic{left: 15px}
		.d-2 a {font-size: 12px;font-weight: 400;background-color: rgba(180,40,45, 0.2);color: #b56622;padding: 0 4px}
		.pop_up_bc{width: 100vw;height: 100vh;background-color: rgba(0,0,0,0.4);z-index: 10000;display: flex;justify-content: center;align-items: center;position: fixed;top: 0;left:0}
		.pop_up_bc .pop_up{text-align: center;padding: 20px 30px;background-color: #fff;width: 280px;border-radius: 10px}
		.pop_up_bc .pop_up button{padding: 6px 16px;text-align: center;background-color: #ff702a;box-shadow: -2px 2px 6px rgba(255,112,45, 0.5);color: #fff;border: none;font-size: 16px;width: 200px;border-radius: 18px}
		.pop_up_bc .pop_up .title{font-size: 16px;color: #59565a;margin-bottom: 8px}
		.pop_up_bc .pop_up .msg{font-size: 14px;color: #9a979b;margin-bottom: 10px}
		.pop_up_bc .pop_up img{width: calc(100% - 5px);margin: 0 0 15px 5px;}
		.pop_up_bc .pop_up .cover{position: relative;width: 100%}
		.pop_up_bc .pop_up .cover:after {position: absolute;content: '';width: 100%;height: 100%; top: 0;left: 0;box-shadow:0 0 10px 10px #ffffff inset;}
</style>
<body>
<div class="mui-content">
	<div class="prdTop" id="head">	
		<div class="back iconfont icon-fanhui1" onclick="history.length != 1 ? history.back() : location='https://www.tongcaigou.com/mobile/index'"></div>
		<ul>
			<li class="on"><i class="iconfont">&#xe79c;</i>宝贝</li>
			<li>评价</li>
			<li>推荐</li>
			<li>详情</li>
		</ul>
	</div>
	<div class="swiper-container">
		<div class="swiper-wrapper" id="slide">
			{{range .info.imgs}}
			<div class="swiper-slide" style="background-image: url({{.}});"></div>
			{{end}}
		</div>
		<div class="swiper-pagination"></div>
	</div>
	{{if .gbuy}}
	<div class="surplus" data-id="1" onclick="show(this)" price="{{.gbuy.price}}">
		<div class="title">
			<p>￥<span>{{.gbuy.price}}</span></p>
			<div>
				<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/prd/gp.png">
				<s>&yen;{{.info.price}}</s>
			</div>
			<p style="background-color: rgba(0,0,0,0.4); text-align: center; margin-right: 10px; border-radius: 20px; overflow: hidden; position: relative;">
				<span style="font-size: 9pt; height: 20px; line-height: 20px; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 5; text-shadow: 0 0 3px #888;">团购进度 {{.gbuy.jnum}}/{{.gbuy.num}}</span>
				<span style="width: 0%; background-color: #FFFFE0; height: 100%; position: absolute; top: 0; left: 0; z-index: 1;"></span>
			</p>
		</div>
		<div class="time">
			<p>距离结束还剩</p>
			<div id="time" style="font-size:12px;">{{.gbuy.sysj}}</div>
			<p style="font-size:18px;">立即购买!</p>
		</div>
	</div>
	{{end}}
	<div class="mt-caption">
		<dl>

			<dd class="d-2">
				{{if .info.vprice}}
				<b>&yen;{{.info.vprice}}<span class="b_s">{{.info.price}}</span></b>
				{{else}}
				<b style="display: block;">&yen;{{.info.price}}</b>
				<a>登陆并联系客服成为会员即可享受大量折扣</a>
				{{end}}
			</dd>
			<dt>{{.info.title}}<br>
				<i style="margin-right: 10px;">{{.info.number}}{{.info.spec}}/箱 </i>
				<i>产品尺寸 : {{.info.size}}</i>
				{{if .info.description}}<i>{{.info.description}}</i>{{end}}
				<br>
			每箱 &yen;{{if .info.vprice}}{{.info.vpricem}}{{else}}{{.info.pricem}}{{end}}</dt>
			<dd class="f">
				{{if .shop}}
				<span class="b23">商家供应 {{.shop.shen}}{{.shop.shi}}</span>
				{{else}}
				<span class="b23">统采自营</span> <i class="iconfont">&#xe812;</i> 已通过认证
				{{end}}
				<span class="fr" id="share" href=""><i class="mui-icon iconfont">&#xe6e7;</i></span>
			</dd>
		</dl>
		<ol>
			<li class="tx-l"><i class="iconfont">销量：</i> {{.info.sellnum}}</li>
			<li><i class="iconfont">库存：</i> {{.info.inventory}}</li>
			<li class="tx-r"><i class="iconfont">浏览：</i> {{.info.click}}</li>
		</ol>
	</div>

	<div id="screen"></div>
	<div id="product_specification">
		<div class="speci_header">
			<img src="{{.info.pathname}}">
			<div>
				<p class="on" >&yen; <span id="price">{{.info.pricem}}</span></p>
				<p>库存：<span id="inventory">{{.info.inventory}}</span></p>
				<p class="overpl2">
					规格：
					<span id="spec1">"{{.info.number}}{{.info.spec}}/箱"</span> 
				</p>
			</div>
			<span id="close">
				<span class="mui-icon mui-icon-closeempty"></span>
			</span>
		</div>
		<div class="sftype">
			<div>
				<h1>温馨提示：</h1>
				<p class="gie2">
					{{if .shop}}
					<span class="spec on" data-spec="0">箱 / 每箱<em class="num">{{.info.number}}</em>{{.info.spec}}</span>
					<span class="spec" data-spec="1"><em class="num">件</em></span>
					{{else}}
					<span class="on">每箱<em class="num">{{.info.number}}</em>{{.info.spec}} 最少购买{{if .gbuy}}{{.gbuy.min}}{{else}}{{.info.minbuy}}{{end}}箱</span>
					{{end}}
				</p>
			</div>
		</div>
		<div class="num quantum">
				购买数量
				<div class="mui-numbox fr" data-numbox-min="{{if .gbuy}}{{.gbuy.min}}{{else}}{{.info.minbuy}}{{end}}" data-numbox-max="">
					<button class="mui-btn mui-btn-numbox-minus" type="button" disabled="">-</button>
					<input id="number" class="mui-input-numbox" type="number" value="1">
					<button class="mui- btn mui-btn-numbox-plus" type="button">+</button>
				</div>
			</div>
		<span class="gwcbtn" id="determine">加入购物车</span>
		<span id="goumai" class="gwcbtn ljbuy">立即购买</span>
	</div>
	{{if .coupon}}
	<div class="coupons" style="margin-top: 10px">
		<dl>
			<dt>领券</dt>
			<dd><span>店铺优惠券</span></dd>
			<dd>{{index .coupon 0 "name"}}</dd>
		</dl>
	</div>
	{{end}}
	

	<div id="pl" class="mt-programa" style="margin-top: 10px">
		<dl>
			<dt>评价 ( {{.enum}} )</dt>
		</dl>
	</div>
	<div class="pj-message">
		{{if .evaluate}}
		<a href="/mobile/column/product_evaluate?id={{.info.id}}">
			<div class="header">
				<img class="pic" src="{{.evaluate.pathname}}">
				<dt class="overpl1" style="color:#5A6793;">{{.evaluate.monicker}}</dt>
				{{if eq .evaluate.score "5"}}
				<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/prd/5x.png">
				{{else if eq .evaluate.score "4"}}
				<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/prd/4x.png">
				{{else if eq .evaluate.score "3"}}
				<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/prd/3x.png">
				{{else if eq .evaluate.score "2"}}
				<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/prd/2x.png">
				{{else if eq .evaluate.score "1"}}
				<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/prd/1x.png">
				{{end}}
			</div>
			<div>
				<p class="overpl2">{{.evaluate.content}}</p>
				<ul>
					{{range .evaluate.imgs}}
					<li class="pjw"><img src="{{.pathname}}"></li>
					{{end}}
				</ul>
				<ol><i class="iconfont">&#xe6df;</i> {{.evaluate.addtime}}</ol>
			</div>
		</a>
		{{else}}
		暂无评论
		{{end}}
		{{if .evaluate}}
		<div class="tx-c more">
			<a href="/mobile/column/product_evaluate?id={{.info.id}}">
				查看更多评价<i class="mui-icon-extra mui-icon-extra-arrowrightcricle"></i>
			</a>
		</div>
		{{end}}
	</div>

	<div class="mt-programa mt-10" style="border-left: 5px solid #e31939;" id="re">
		<dl style="padding: 5px 10px;">
			<dt>{{if .recommend}}为您推荐{{else}}暂无推荐{{end}}</dt>
		</dl>
	</div>
	<style type="text/css">
		.mt-mall-product a{position: relative;}
		.mt-mall-product a .x{position: absolute;top: 0;right: 10px;width: 30px;height: 30px;}
	</style> 
	{{if .recommend}}
	<div class="mt-mall-related">
		<div class="mt-mall-product">
			{{range .recommend}}
			<a href="/mobile/column/product_content?id={{.id}}">
				<dl>
					<dt><div class="mt-figure" style="background-image:url({{.pathname}})"></div></dt>
					<dd class="d-1">{{.title}}</dd>
					<dd class="d-2">&#65509;<b>{{if .vprice}}{{.vprice}}{{else}}{{.price}}{{end}}</b></dd>
				</dl>
			{{if eq .active 1}}
			<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/gbuy.png" class="x">
			{{else if eq .active 2}}
			<img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/sales.png" class="x">
			{{end}}
			</a>
			{{end}}
		</div>
	</div>
	{{end}}
	<div class="mt-company">
		<div class="logo"><img src="{{if .info.cimg}}{{.info.cimg}}{{else}}/static/wechat/img/index/logo.png{{end}}"/></div>
		<dl>
			<dt>{{if .info.cname}}{{.info.cname}}{{else}}统采商城{{end}}</dt>
		</dl>
		<ul>
			<li><a href="/mobile/contact_service?id={{.info.gid}}" class="a">联系客服</a></li>
			<li><a href="/mobile/index/shop?id={{.info.gid}}" class="a on">进店逛逛</a></li>
		</ul>
		<!-- <img class="x" src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/template/img/t-3.png"/> -->
	</div>
	<div id="xq" class="rcmdHd"><span>产品详情</span></div>
	<div class="mt-10 apic">
		<div class="parameter">
			<table>
				<tr>
					<th colspan="2">规格参数</th>
				</tr>
				<tr>
					<td>品牌</td>
					<td>{{.info.bname}}</td>
				</tr>
				<tr>
					<td>品名</td>
					<td>{{.info.title}}</td>
				</tr>
				<tr>
					<td>货号</td>
					<td>{{.info.model}}</td>
				</tr>
				<tr>
					<td>条形码</td>
					<td>{{.info.barcode}}</td>
				</tr>
				<tr>
					<td>装箱数</td>
					<td>{{.info.number}}</td>
				</tr>
				<tr>
					<td>产品尺寸</td>
					<td>{{.info.size}}</td>
				</tr>
				<tr>
					<td>单个重量</td>
					<td>{{.info.weight}}</td>
				</tr>
				<tr>
					<td>外箱尺寸</td>
					<td>{{.info.length}}*{{.info.width}}*{{.info.height}}</td>
				</tr>
				{{if .info.material}}
				<tr>
					<td>材质</td>
					<td>{{.info.material}}</td>
				</tr>
				{{end}}
				<!-- {{range .info.attrs}}
				<tr>
					<td>{{.name}}</td>
					<td>{{.value}}</td>
				</tr>
				{{end}}
				{{range .info.parameter}}
				<tr>
					<td>{{.key}}</td>
					<td>{{.value}}</td>
				</tr>
				{{end}} -->
			</table>
		</div>
		<div class="details">
			{{if .info.content}}
			{{str2html .info.content}}
			{{end}}
		</div>
	</div>
</div>
<div class="coupons_list_m">
		<div class="coupons_list_mask"></div>
		<div class="coupons_list">
			<div class="coupon">
				<ul>
					{{range .coupon}}
					<li>
						<div class="price">
							<p>&yen;{{.offer}}</p>
						</div>
						<div class="get_coupon" >
							{{if eq .isget 1}}
							<button disabled="">已领取</button>
							{{else}}
							<button data-id="{{.id}}" class="lq">立即领取</button>
							{{end}}
						</div>
						<div class="cou_t">
							<p>{{.starttime}} - {{.endtime}}</p>
						</div>
						<p>{{.name}}</p>
					</li>
					{{end}}
				</ul>
			</div>	
		</div>
	</div>
	<style type="text/css">
		#guider{width: 100vw;height: 100vh;background-image: url('/static/wechat/img/pshare.png');background-size: 70%;background-repeat: no-repeat;
		background-position:50% 18%;background-color: rgba(0,0,0,0.5);position: fixed;top: 0;left: 0;z-index: 99999;display: none;}
	</style>
	<div id="guider"></div>
<footer>
	<nav class="mui-bar mui-bar-tab">
		<div class="join_car join_tb">
			<a id="kefu" href="javascript:void(0);" οnclick="openService()">
				<span class="iconfont">&#xe805;</span><br>
				<span >客服</span>
			</a>
			<a id="gouwuche" href="/mobile/shopcar">
				<span class="iconfont">&#xe739;</span><br>
				<span >购物车</span>
				{{if .shopcarnum}}{{if ne .shopcarnum "0"}}<b id="catnum">{{.shopcarnum}}</b>{{end}}{{end}}
			</a>
			<a href="javascript:void(0)" id="collection" data-status="{{.iscollect}}">
				{{if eq .iscollect 1}}
				<span class="iconfont" style="color:#f40">&#xe6f4;</span><br>
				{{else}}
				<span class="iconfont">&#xe6f5;</span><br>
				{{end}}
				<span >收藏</span>
			</a>
		</div>
		<div class="join_car buy_car">
			<span class="join" data-id="0" onclick="show(this)">加入购物车</span>
			<span class="buy" data-id="0" onclick="show(this)">立即购买</span>
		</div>
	</nav>
</footer>
<div class="pop_up_bc">
	<div class="pop_up">
		<div class="title">价格优惠提醒</div>
		<div class="msg">登陆并联系客服成为会员即可享受大量折扣</div>
		<div class="cover">
			<img src="/static/WechatIMG5.png" />
		</div>
		<button onclick="popUpOn()">好的，知道了</button>
	</div>
</div>
<div class="shopclassification">
	<ul>
		{{range .service}}
		<a class="goto" href="/mobile/contact_service?id={{.id}}"><li>{{.monicker}}</li></a>
		{{end}}
	</ul>
	<img class="pic" src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/di.png">
</div>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/js/other/app.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/js/other/video.min.js"></script>
<script type="text/javascript" src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/swiper/js/swiper.min.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/js/zepto.min.js"></script>
{{template "wechat/public/share.html" .}}
<script>
	console.log({{.info}})
	if (window.localStorage.getItem("fitst_go")) {
		$(".pop_up_bc").hide()
	}
	function popUpOn () {
		$(".pop_up_bc").hide()
		window.localStorage.setItem("fitst_go", true)
	}
	var pricem='0.00'
	var price='0.00'
	{{if .info.vprice}}
	pricem="{{.info.vpricem}}"
	price="{{.info.vprice}}"
	{{else}}
	pricem="{{.info.pricem}}"
	price="{{.info.price}}"
	{{end}}
	var spec=0;
	document.getElementById('kefu').addEventListener('tap',function(){
		$('.shopclassification').css('display','block')
	})
	$('.shopclassification').click(function(){
		$(this).css('display','none')
	})
	$('.spec').click(function(){
		$('.spec').each(function(){
			$(this).attr('class','spec')
		})
		$(this).attr('class','spec on')
		spec=$(this).attr('data-spec')
		if(spec==1){
			$('#price').html(price)
		}else{
			$('#price').html(pricem)
		}
	})
	$('.lq').click(function(){
		var that=this
		that.disabled=true
		var id=$(this).attr('data-id')
		$.ajax({
			url:window.location.href,
			data:{yid:id},
			type:'post',
			success:function(res){
				that.disabled=false
				if(res==2){
					mui.confirm("您还未登入,请先登入","提示",function(res){
						if(res.index){
							mui.closePopups()
							window.location.href="/mobile/login"
						}
					})
				}else if(res==1){
					mui.toast("领取成功~")
					that.innerHTML='已领取'
					that.disabled=true
				}else if(res==0){
					mui.toast("网络繁忙,请重试!")
				}else if(res==3){
					that.disabled=true
					that.innerHTML='已领取'
					mui.toast("已经领取过了")
				}
			}
		})
	})
	$('.coupons').click(function(){
		$('.coupons_list_m').css('display','block')
		$('.coupons_list').attr('class','coupons_list sheet')
		document.getElementsByClassName('coupons_list_mask')[0].addEventListener('touchmove',function(e){
			e.preventDefault()
		})
	})
	$('.coupons_list_mask').click(function(){
		$('.coupons_list_m').css('display','none')
	})
	{{if .gbuy}}
	function timecut(){
		var ti=document.getElementById("time")
		var t=ti.innerHTML
		t=t.split(":")
		if(t.length==0){
			history.go(0)
		}else if(t.length==1){
			t[0]=t[0]-1
			if(t==0){
				t[0]="00"
				history.go(0)
			}else if(t[0]<10){
				t[0]="0"+t[0]
			}
		}else if(t.length==2){
			if(t[1]==0){
				if (t[0]==1) {
					t[1]="59"
					t[0]="00"
				}else{
					t[0]=t[0]-1
					if(t[0]==-1){
						t[1]="00"
						t[0]="00"
						history.go(0)
					}else if(t[0]<10){
						t[0]="0"+t[0]
					}
					t[1]=59
				}
			}else{
				t[1]=t[1]-1
				if(t[1]<10){
					t[1]="0"+t[1]
				}
			}
		}else if(t.length==3){
			if(t[2]==0){
				t[2]=59
				if(t[1]=="00"){
					if(t[0]=="00"){
						t[0]="00"
						t[1]="00"
						t[2]="00"
						history.go(0)
					}else if(t[0]<=10){
						t[0]=t[0]-1
						t[0]="0"+t[0]
						t[1]=59
						t[2]=59
					}else{
						t[0]=t[0]-1
						t[1]=59
						t[2]=59
					}
				}else if(t[1]<=10){
					t[1]=t[1]-1
					t[1]="0"+t[1]
					t[2]=59
				}else{
					t[1]=t[1]-1
					t[2]=59
				}
			}else{
				t[2]=t[2]-1
				if(t[2]<10){
					t[2]="0"+t[2]
				}
			}
		}
		ti.innerHTML=t.join(":")
	}
	setInterval(timecut,1000)
	{{end}}
</script>
<script>
	var head=document.getElementById("head")
	var pl=document.getElementById("pl")
	var re=document.getElementById("xq")
	var head_height=$('#head').offset().top
	var pl_height=$('#pl').offset().top-45
	var re_height=$('#re').offset().top-45
	var xq_height=$('#xq').offset().top-60
	$('.prdTop li').click(function(){
		var zid=$(this).index()
		$('.prdTop li').attr('class','')
		$('.prdTop li').each(function(){
			if($(this).find('i')){
				$(this).find('i').remove()
			}
		})
		$(this).attr('class','on')
		$(this).prepend(`<i class="iconfont">&#xe79c;</i>`)
		switch (zid){
			case 0:
			$('body').scrollTop(head_height)
			break
			case 1:
			$('body').scrollTop(pl_height)
			break
			case 2:
			$('body').scrollTop(re_height)
			break
			case 3:
			$('body').scrollTop(xq_height)
			break
		}
	})
	window.onscroll=function(){
		$('.prdTop li').attr('class','')
		$('.prdTop li').each(function(){
			if($(this).find('i')){
				$(this).find('i').remove()
			}
		})
		var scrollheight=$('body').scrollTop()
		if(scrollheight<pl_height){
			$('.prdTop li:nth-of-type(1)').attr('class','on')
			$('.prdTop li:nth-of-type(1)').prepend(`<i class="iconfont">&#xe79c;</i>`)
		}else if(scrollheight>=pl_height&&scrollheight<re_height){
			$('.prdTop li:nth-of-type(2)').attr('class','on')
			$('.prdTop li:nth-of-type(2)').prepend(`<i class="iconfont">&#xe79c;</i>`)
		}else if(scrollheight>=re_height&&scrollheight<xq_height){
			$('.prdTop li:nth-of-type(3)').attr('class','on')
			$('.prdTop li:nth-of-type(3)').prepend(`<i class="iconfont">&#xe79c;</i>`)
		}else if(scrollheight>=xq_height){
			$('.prdTop li:nth-of-type(4)').attr('class','on')
			$('.prdTop li:nth-of-type(4)').prepend(`<i class="iconfont">&#xe79c;</i>`)
		}
	}
	var swiper = new Swiper('.swiper-container', {
		pagination: '.swiper-pagination',
		paginationClickable: true,
		loop:true,
		// autoplay:3500
	});
</script>
<script>
	var pid={{.info.id}};
	document.getElementById("goumai").addEventListener('tap',function(){
		var num=document.getElementById("number").value
		var inventory=document.getElementById('inventory').innerHTML
		if (parseInt(num)>parseInt(inventory)){
			mui.alert("库存不足")
			// mui.confirm(",是否提醒缺货?","提示",function(res){
			// 	if(res.index){
			// 		mui.post('/mobile/column/product_lost',{num:num,pid:pid},function(res){
			// 			if(res==2){
			// 				mui.confirm("您还未登入,请先登入","提示",function(res){
			// 					if(res.index){
			// 						mui.closePopups()
			// 						window.location.href="/mobile/login"
			// 					}
			// 				})
			// 			}else if(res==1){
			// 				mui.toast("提醒成功~")
			// 			}else if(res==0){
			// 				mui.toast("网络繁忙,请重试!")
			// 			}else if(res==3){
			// 				mui.toast("您已经提示过了")
			// 			}
			// 		})	
			// 	}
			// })
		}else{
			$.ajax({
				url:'/mobile/shopcar/buy',
				data:{num:num,pid:pid,type:ordert,spec:spec},
				success:function(res){
					if(res.status==0){
						mui.toast("网络繁忙,请重试!")
					}else if (res.status==1){
						window.location.href='/mobile/shopcar/sure?cid='+res.cid
					}else{
						mui.confirm("您还未登入,请先登入","提示",function(res){
							if(res.index){
								mui.closePopups()
								window.location.href="/mobile/login"
							}
						})
					}
				}
			})
		}
	})
	document.getElementById('collection').addEventListener('tap',function(){
	// $('#collection').click(function(){
		var status=this.getAttribute("data-status");
		var that=this;
		if (status==1){	
			mui.confirm("您确定要取消收藏吗?","提示",function(data){
				if(data.index){
					mui.closePopups()
					mui.post('/mobile/column/prduct_collect',{id:pid},function(res){
						if(res==1){
							var html='<span class="iconfont" style="color:#f40">&#xe6f4;</span><br><span>收藏</span>'
							if (status==0){
								mui.toast("收藏成功~")
							}else{
								html=`<span class="iconfont">&#xe6f5;</span><br><span>收藏</span>`
								mui.toast("取消收藏成功!")
							}
							that.setAttribute("data-status", Math.abs(status-1))
							that.innerHTML=html
						}else if(res==0){
							if (status==0){
								mui.toast("收藏失败,请重试!")
							}else{
								mui.toast("取消收藏失败,请重试!")
							}
						}else if(res==2){
							mui.confirm("您还未登入,请先登入","提示",function(res){
								if(res.index){
									mui.closePopups()
									window.location.href="/mobile/login"
								}
							})
						}

					})
				}
			})
		}else{
			mui.post('/mobile/column/prduct_collect',{id:pid},function(res){
				if(res==1){
					var html='<span class="iconfont" style="color:#f40">&#xe6f4;</span><br><span>收藏</span>'
					if (status==0){
						mui.toast("收藏成功~")
					}else{
						html=`<span class="iconfont">&#xe6f5;</span><br><span>收藏</span>`
						mui.toast("取消收藏成功!")
					}
					that.setAttribute("data-status", Math.abs(status-1))
					that.innerHTML=html
				}else if(res==0){
					if (status==0){
						mui.toast("网络繁忙,请重试!")
					}else{
						mui.toast("网络繁忙,请重试!")
					}
				}else if(res==2){
					mui.confirm("您还未登入,请先登入","提示",function(res){
						if(res.index){
							mui.closePopups()
							window.location.href="/mobile/login"
						}
					})
				}

			})
		}
	})
	document.getElementById('determine').addEventListener('tap',function(){
		var num=document.getElementById('number').value
		var inventory=document.getElementById('inventory').innerHTML
		if (parseInt(num)>parseInt(inventory)){
			mui.alert("库存不足")
			// mui.confirm("库存不足,是否提示缺货?","提示",function(res){
			// 	if(res.index){
			// 		mui.closePopups()
			// 		mui.post('/mobile/column/product_lost',{num:num,pid:pid},function(res){
			// 			if(res==2){
			// 				mui.confirm("您还未登入,请先登入","提示",function(res){
			// 					if(res.index){
			// 						mui.closePopups()
			// 						window.location.href="/mobile/login"
			// 					}
			// 				})
			// 			}else if(res==1){
			// 				mui.toast("提醒成功~")
			// 			}else if(res==0){
			// 				mui.toast("网络繁忙,请重试!")
			// 			}else if(res==3){
			// 				mui.toast("您已经提示过了")
			// 			}
			// 		})
			// 	}
			// })
		}else{
			var data={num:num,pid:pid,spec:spec}
			mui.post('/mobile/shopcar_p',data,function(res){
				if(res.status==2||res==962){
					mui.confirm("您还未登入,请先登入","提示",function(res){
						if(res.index){
							mui.closePopups()
							window.location.href="/mobile/login"
						}
					})
				}else if(res.status==1){
					var catnum=document.getElementById('catnum')
					if(catnum){
						catnum.innerHTML=res.num
					}else{
						var b=document.createElement('b')
						b.setAttribute("id", 'catnum')
						b.innerHTML=res.num
						document.getElementById('gouwuche').appendChild(b)
					}
					screen.style.display='none';
					product.style.height=''
					mui.toast("添加成功~")
				}else if(res.status==0){
					mui.toast("网络繁忙,请重试!")
				}else if(res.status==3){
		          mui.toast('库存不足');
		        }
			})
		}
	})
	mui.init({
        swipeBack:true //启用右滑关闭功能
    });
    //释放 nav 底部导航 a 链接
    mui('.mui-tab-item').each(function () {
        this.addEventListener('tap',function () {
            var url = this.getAttribute('href');
            if(url){
            window.location.href=url;
            }
        })
    });
    // mui('body').on('tap','a',function(){
    // 	var h=this.getAttribute('href')
    // 	if(h){
    // 		window.location.href=h
    // 	}
    // })
    // var pjw =document.getElementsByClassName('pjw');
    // for (var i = 0; i < pjw.length; i++) {
    // 	pjw[i].style.height=pjw[i].offsetWidth+'px';
    // }

	var guide=document.getElementById('guider');
    document.getElementById('share').addEventListener('tap',function(){
		guide.style.display='block';
	});
	guide.addEventListener('tap',function(){
		guide.style.display='none';
	});
	document.getElementById('close').addEventListener('tap',function(){
		screen.style.display='none';
		product.style.height=''
	});
	document.getElementById('screen').addEventListener('tap',function(){
		screen.style.display='none';
		product.style.height=''
	});
	var screen=document.getElementById('screen');
	var product=document.getElementById('product_specification');
	var ordert;
	function show(e) { 
		ordert=e.getAttribute("data-id")
		if (product.style.height=='') {
			screen.style.display='block';
			product.style.height='325px'
		}else{
			product.style.height=''
			screen.style.display='none';
		}
		var num={{.info.number}};
		if(ordert==0){
			var gprice={{if .info.vprice}}{{.info.vprice}}{{else}}{{.info.price}}{{end}};
			gpricem=parseFloat(gprice)*parseFloat(num)
			$('#determine').css('display','block')
			$('#goumai').css('width','50%')
		}else{
			var gprice=e.getAttribute('price');
			gpricem=parseFloat(gprice)*parseFloat(num)
			$('#price').html(gpricem.toFixed(2))
			$('#goumai').css('width','100%')
			$('#determine').css('display','none')
		}
	}
</script>
<div class="mt-statistics">统计代码</div>
</body>
</html>
